# -*- coding: utf-8 -*-
"""
-------------------------------------------------
Project Name: luffcity study project
File Name: 多装饰器练习.py
Author: kij
Create Date: 2021/2/14
-------------------------------------------------
"""


# 自下而上的加载顺序
# 执行顺序自上而下执行
def deco1(func1):
	print("第一个装饰器运行方法deco1")
	def wrapper(*args, **kwargs):
		print("第一个装饰器运行方法")
		res1 = func1(*args, **kwargs)
		return res1

	return wrapper


def deco2(func2):
	print("第二个装饰器运行方法deco2")
	def wrapper2(*args, **kwargs):
		print("第二个装饰器运行方法")
		res2 = func2(*args, **kwargs)
		return res2

	return wrapper2


def deco3(x):
	def outter(func3):
		print("第三个装饰器运行方法,接收到一个参数{}".format(x))
		def wrapper3(*args, **kwargs):
			print("第三个装饰器运行方法")
			res3 = func3(*args, **kwargs)
			return res3

		return wrapper3

	return outter


@deco1
@deco2
@deco3(1000)
def index(x, y):
	print("index的参数一为:{}参数二为:{}".format(x, y))


index(300, 500)
